<?php

/**
 * FR_Presenter_php
 */
class FR_Presenter_php extends FR_Presenter_common {

    public function __construct(FR_Module $module) {
        parent::__construct($module);
    }

    public function display() {
        $__data = $this->module->getData();
        if (is_array($__data)) {
            foreach (array_keys($__data) as $d) {
                $$d = $__data[$d];
            }
        }


        // START HTML
        echo '<html>';
        echo '<head>';
        echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
        echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
        echo '<title>RSkeleton</title>';
        echo '<link rel="stylesheet" href="' . FR_PUBLIC_PATH . '/Bootstrap/3.3.1/css/bootstrap.min.css">';

        echo '<!--[if lt IE 9]>';
        echo '<script src="' . FR_PUBLIC_PATH . '/IE8/html5shiv/3.7.2/html5shiv.min.js"></script>';
        echo '<script src="' . FR_PUBLIC_PATH . '/IE8/respond/1.4.2/respond.min.js"></script>';
        echo '<![endif]-->';

        echo '<script src="' . FR_PUBLIC_PATH . '/jQuery/jquery-1.11.2.min.js"></script>';
        echo '<script src="' . FR_PUBLIC_PATH . '/Bootstrap/3.3.1/js/bootstrap.min.js"></script>';
        
        echo '</head>';
        echo '<body>';

        $template = FR_APPLICATION_DIR . "/" . $this->module->moduleName . "/" . $this->module->getTplFile();
        if (file_exists($template)) {
            include $template;
        }

        echo "</body></html>";
    }

    public function __destruct() {
        parent::__destruct();
    }

}
